package cn._2dland.leech.util;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class LeechUtils {
	public static String readResopnseStream(InputStream in) {
		String result = null;
		try {
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			byte[] buf = new byte[1024];
			for(int len = 0; (len = in.read(buf)) >= 0; ) {
				baos.write(buf, 0, len);
			}
			baos.flush();
			result = new String(baos.toByteArray());
			baos.close();
		} catch (Exception e) {
			e.printStackTrace(System.err);
		}
		return result;
	}
}
